home *** CD-ROM | disk | FTP | other *** search
/ CD BIT 75 / CD BIT 75.iso / Software / gimp-2.0.5-i586-setup / gimp-2.0.5-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / comic-logo.scm < prev    next >
Encoding:
GIMP Script-Fu Script  |  2004-09-26  |  5.9 KB  |  160 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; This program is free software; you can redistribute it and/or modify
  4. ; it under the terms of the GNU General Public License as published by
  5. ; the Free Software Foundation; either version 2 of the License, or
  6. ; (at your option) any later version.
  7. ; This program is distributed in the hope that it will be useful,
  8. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10. ; GNU General Public License for more details.
  11. ; You should have received a copy of the GNU General Public License
  12. ; along with this program; if not, write to the Free Software
  13. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. ;
  15. ;  Comic Book Logo v0.1  04/08/98
  16. ;  by Brian McFee
  17. ;  Creates snazzy-looking text, inspired by watching a Maxx marathon :)
  18.  
  19. (define (apply-comic-logo-effect img
  20.                  logo-layer
  21.                  gradient
  22.                  gradient-reverse
  23.                  ol-width
  24.                  ol-color
  25.                  bg-color)
  26.   (let* ((width (car (gimp-drawable-width logo-layer)))
  27.      (height (car (gimp-drawable-height logo-layer)))
  28.      (posx (- (car (gimp-drawable-offsets logo-layer))))
  29.      (posy (- (cadr (gimp-drawable-offsets logo-layer))))
  30.      (bg-layer (car (gimp-layer-new img width height RGBA-IMAGE
  31.                     "Background" 100 NORMAL-MODE)))
  32.      (white-layer (car (gimp-layer-copy logo-layer 1)))
  33.      (black-layer (car (gimp-layer-copy logo-layer 1)))
  34.      (old-gradient (car (gimp-gradients-get-gradient)))
  35.      (old-fg (car (gimp-palette-get-foreground)))
  36.      (old-bg (car (gimp-palette-get-background))))
  37.  
  38.     (script-fu-util-image-resize-from-layer img logo-layer)
  39.     (gimp-image-add-layer img bg-layer 1)
  40.     (gimp-image-add-layer img white-layer 1)
  41.     (gimp-layer-translate white-layer posx posy)
  42.     (gimp-drawable-set-name white-layer "White")
  43.     (gimp-image-add-layer img black-layer 1)
  44.     (gimp-layer-translate black-layer posx posy)
  45.     (gimp-drawable-set-name black-layer "Black")
  46.   
  47.     (gimp-selection-all img)
  48.     (gimp-palette-set-background bg-color)
  49.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  50.     (gimp-selection-none img)
  51.  
  52.     (gimp-layer-set-preserve-trans white-layer TRUE)
  53.     (gimp-palette-set-background ol-color)
  54.     (gimp-selection-all img)
  55.     (gimp-edit-fill white-layer BACKGROUND-FILL)
  56.     (gimp-layer-set-preserve-trans white-layer FALSE)
  57.     (plug-in-spread 1 img white-layer (* 3 ol-width) (* 3 ol-width))
  58.     (plug-in-gauss-rle 1 img white-layer (* 2 ol-width) 1 1)
  59.     (plug-in-threshold-alpha 1 img white-layer 0)
  60.     (gimp-layer-set-preserve-trans white-layer TRUE)
  61.     (gimp-edit-fill white-layer BACKGROUND-FILL)
  62.     (gimp-selection-none img)
  63.  
  64.     (gimp-palette-set-background '(0 0 0))
  65.     (gimp-layer-set-preserve-trans black-layer TRUE)
  66.     (gimp-selection-all img)
  67.     (gimp-edit-fill black-layer BACKGROUND-FILL)
  68.     (gimp-selection-none img)
  69.     (gimp-layer-set-preserve-trans black-layer FALSE)
  70.     (plug-in-gauss-rle 1 img black-layer ol-width 1 1)
  71.     (plug-in-threshold-alpha 1 img black-layer 0)
  72.  
  73.     (gimp-gradients-set-gradient gradient)
  74.     (gimp-layer-set-preserve-trans logo-layer TRUE)
  75.     (gimp-selection-all img)
  76.  
  77.     (gimp-edit-blend logo-layer CUSTOM-MODE NORMAL-MODE
  78.              GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
  79.              FALSE 0 0 TRUE
  80.              0 (* height 0.3) 0 (* height 0.78))
  81.  
  82.     (plug-in-noisify 1 img logo-layer 0 0.20 0.20 0.20 0.20)
  83.     (gimp-selection-none img)
  84.     (gimp-layer-set-preserve-trans logo-layer FALSE)
  85.     (gimp-brightness-contrast logo-layer 0 30)
  86.     (plug-in-threshold-alpha 1 img logo-layer 60)
  87.     (gimp-image-set-active-layer img logo-layer)
  88.     (gimp-gradients-set-gradient old-gradient)
  89.     (gimp-palette-set-background old-bg)
  90.     (gimp-palette-set-foreground old-fg)))
  91.  
  92. (define (script-fu-comic-logo-alpha img
  93.                     logo-layer
  94.                     gradient
  95.                     gradient-reverse
  96.                     ol-width
  97.                     ol-color
  98.                     bg-color)
  99.   (begin
  100.     (gimp-image-undo-group-start img)
  101.     (apply-comic-logo-effect img logo-layer
  102.                  gradient gradient-reverse
  103.                  ol-width ol-color bg-color)
  104.     (gimp-image-undo-group-end img)
  105.     (gimp-displays-flush)))
  106.  
  107. (script-fu-register "script-fu-comic-logo-alpha"
  108.             _"<Image>/Script-Fu/Alpha to Logo/Comic Boo_k..."
  109.             "Comic-book Style Logos"
  110.             "Brian McFee <keebler@wco.com>"
  111.             "Brian McFee"
  112.             "April 1998"
  113.             "RGBA"
  114.                     SF-IMAGE      "Image"             0
  115.                     SF-DRAWABLE   "Drawable"          0
  116.             SF-GRADIENT   _"Gradient"         "Incandescent"
  117.             SF-TOGGLE     _"Gradient Reverse" FALSE
  118.             SF-ADJUSTMENT _"Outline Size"     '(5 1 100 1 10 0 1)
  119.             SF-COLOR      _"Outline Color"    '(255 255 255)
  120.             SF-COLOR      _"Background Color" '(255 255 255))
  121.  
  122.  
  123. (define (script-fu-comic-logo text
  124.                   size
  125.                   font
  126.                   gradient
  127.                   gradient-reverse
  128.                   ol-width
  129.                   ol-color
  130.                   bg-color)
  131.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  132.          (border (/ size 4))
  133.      (text-layer (car (gimp-text-fontname
  134.                img -1 0 0 text border TRUE size PIXELS font))))
  135.     (gimp-image-undo-disable img)
  136.     (gimp-drawable-set-name text-layer text)
  137.     (apply-comic-logo-effect img text-layer gradient gradient-reverse
  138.                  ol-width ol-color bg-color)
  139.     (gimp-image-undo-enable img)
  140.     (gimp-display-new img)))
  141.  
  142. (script-fu-register "script-fu-comic-logo"
  143.             _"<Toolbox>/Xtns/Script-Fu/Logos/Comic Boo_k..."
  144.             "Comic-book Style Logos"
  145.             "Brian McFee <keebler@wco.com>"
  146.             "Brian McFee"
  147.             "April 1998"
  148.             ""
  149.             SF-STRING     _"Text"               "Moo"
  150.             SF-ADJUSTMENT _"Font Size (pixels)" '(85 2 1000 1 10 0 1)
  151.             SF-FONT       _"Font"               "Tribeca"
  152.             SF-GRADIENT   _"Gradient"           "Incandescent"
  153.             SF-TOGGLE     _"Gradient Reverse"   FALSE
  154.             SF-ADJUSTMENT _"Outline Size"       '(5 1 100 1 10 0 1)
  155.             SF-COLOR      _"Outline Color"      '(255 255 255)
  156.             SF-COLOR      _"Background Color"   '(255 255 255))
  157.